import { http } from '@/tool/utils'
import { iPb } from '@/protobuf/interface'

export function ListMember(data: iPb.Admin.IListMemberRequest):Promise<iPb.Admin.IListMemberResponse> {
    return http.post("ListMember",iPb.Admin.ListMemberRequest.toObject(iPb.Admin.ListMemberRequest.create(data)))
}

export function CreateMember(data: iPb.IDbMember):Promise<iPb.Admin.ICreateMemberResponse> {
    return http.post("CreateMember",iPb.DbMember.toObject(iPb.DbMember.create(data)))
}

export function UpdateMember(data: iPb.IDbMember):Promise<iPb.Admin.IUpdateMemberResponse> {
    return http.post("UpdateMember",iPb.DbMember.toObject(iPb.DbMember.create(data)))
}

export function ReadMember(formData: iPb.Admin.IReadMemberRequest):Promise<iPb.IDbMember> {
    return http.post("ReadMember",iPb.Admin.ReadMemberRequest.create(formData))
}

export function DeleteMember(formData: iPb.Admin.IDeleteMemberRequest):Promise<iPb.Admin.IDeleteMemberResponse> {
    return http.post("DeleteMember",iPb.Admin.DeleteMemberRequest.create(formData))
}
